Skip to content

[release/11.0] Harden identity redirect handling in Blazor template - #70832

Merged
maraf merged 1 commit into
release/11.0from
backport/pr-70796-to-release/11.0
Nov 30, 2026
Merged

maraf merged 1 commit into
release/11.0from
backport/pr-70796-to-release/11.0

Conversation

@github-actions

@github-actions github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

Backport of #70796 to release/11.0

/cc @oroztocil

Harden identity redirect handling in Blazor template

Validate return URLs in the Blazor Identity template's redirect manager

Description

IdentityRedirectManager.RedirectTo in the Blazor Web App template (Individual accounts) checks the raw redirect string, and the check can be bypassed. For example, returnUrl=https://app.example///evil.example redirects to https://evil.example/ after sign-in. This change resolves the URI against the app's base URI and only uses it if the result stays within the app. Anything else redirects to the home page.

Customer Impact

Apps created from the template have an open redirect. A crafted sign-in link can send users to another site after they sign in. Only newly created apps get the fix. Existing apps need to update their copy of IdentityRedirectManager.

Regression?

  • Yes
  • No

Risk

  • High
  • Medium
  • Low

Template-only change to one method. Redirects within the app work as before.

Verification

  • Manual (required)
  • Automated

Checked with a generated app in Chrome. Existing template tests cover the valid redirects.

Packaging changes reviewed?

  • Yes
  • No
  • N/A

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@github-actions
github-actions Bot requested a review from a team as a code owner November 25, 2026 12:21
@oroztocil

Copy link
Copy Markdown
Member

/ba-g Unrelated failures

@maraf maraf added the Servicing-approved Shiproom has approved the issue label Nov 30, 2026
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Hi @github-actions[bot]. This PR was just approved to be included in the upcoming servicing release. Somebody from the @dotnet/aspnet-build team will get it merged when the branches are open. Until then, please make sure all the CI checks pass and the PR is reviewed.

@maraf
maraf merged commit 7a47746 into release/11.0 Nov 30, 2026
32 of 35 checks passed
@maraf
maraf deleted the backport/pr-70796-to-release/11.0 branch November 30, 2026 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Servicing-approved Shiproom has approved the issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants